<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
	<title>留言列表</title>
	<style type="text/css">
		*{
			font-size: 12px;
			font-family: "微软雅黑";
		}
		.board_parent_div{
			width: 100%;
			height: auto;
			overflow: hidden;
		}
		.board_div{
			width: 80%;
			margin-left: 10%;
			border-bottom: 1px solid #ccc;
		}
		.user,.friend{
			color:#2d64b3;
		}
		.send_time{
			color: #666;
			padding-right: : 3px;
		}
		.not_board{
			text-align: center;
			width: 100%;
			font-size: 26px;
		}
	</style>
</head>
<body>
	<div class="board_parent_div">
	
	<c:if test="${empty list}"><div class="not_board">暂无留言</div></c:if>
	
	<c:if test="${not empty list }">
		<c:forEach items="${list}" var="board">
			<div class="board_div">
			<p>
				<img src="${ctx }/upload/${board.user.headImg}" style="vertical-align: middle;width: 50px;">
				<span class="send_time">${board.sendTime}</span>
				<span class="user">${board.user.name}</span>@<span class="friend">${board.firend.name}</span>：<span class="content">${board.content }</span>
			</p>
			<c:if test="${not empty board.childrens }">
			<c:forEach items="${board.childrens}" var="children">
				<p style="margin-left: 5%">
					<img src="${ctx }/upload/${children.user.headImg}" style="vertical-align: middle;width: 40px;">
					<span class="send_time">${children.sendTime}</span>
					<span class="user">${children.user.name}</span>回复@<span class="friend">${children.firend.name}</span>：<span class="content">${children.content }</span>
				</p>
			</c:forEach>
			</c:if>
		</div>
		</c:forEach>
	
	</c:if>
	</div>
</body>
</html>